package com.javaziliao.design.controller;

import com.javaziliao.design.dprecated.state.DeprecatedOrder;
import com.javaziliao.design.pojo.Order;
import com.javaziliao.design.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    @PostMapping("/create")
    public Order createOrder(String productId) {
        return orderService.createOrder(productId);
    }

    @PostMapping("/pay")
    public Order payOrder(String orderId) {
        return orderService.pay(orderId);
    }

    @PostMapping("/send")
    public Order send(String orderId) {
        return orderService.send(orderId);
    }

    @PostMapping("receive")
    public Order receive(String orderId) {
        return orderService.receive(orderId);
    }
}
